package com.sixnimmt.app.server.game.domain;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sixnimmt.app.shared.game.domain.Board;

public class Game {

	public static final int MAX_SCORE = 66;
	public static final int CARDS_BY_PLAYER = 10;
	public static final int MAX_PLAYERS = 10;

	private final Map<String, Player> players;
	private final List<PlayerChoice> playerChoices;
	private final Board board;
	private final Deck deck;
	private boolean started;

	public Game() {
		super();
		players = new HashMap<String, Player>();
		playerChoices = new ArrayList<PlayerChoice>();
		board = new Board();
		deck = new Deck();
		started = false;
	}

	public Map<String, Player> getPlayers() {
		return players;
	}

	public List<PlayerChoice> getPlayerChoices() {
		return playerChoices;
	}

	public Board getBoard() {
		return board;
	}

	public Deck getDeck() {
		return deck;
	}

	public boolean isStarted() {
		return started;
	}

	public void setStarted(boolean started) {
		this.started = started;
	}

	public boolean isChoiceMade(String playerName) {
		for (PlayerChoice choice : playerChoices) {
			if (playerName.equals(choice.getPlayer().getName())) {
				return true;
			}
		}
		return false;
	}

}
